package com.codi.api.xxljob;

import com.codi.bus.core.service.T0Service;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author lvgo
 * @version 1.0
 * @Description: 刷新 T0 job(码表配置是否使用推荐基金，1为使用，0为不使用，不使用时取利率最高一只)
 * 0 0 3,7 * * ?
 * @date 18-6-28 下午5:16
 */
@JobHandler("refreshT0SortListHandler")
@Component
public class RefreshT0SortListHandler extends IJobHandler {
    @Resource
    private T0Service t0Service;

    @Override
    public ReturnT<String> execute(String s) throws Exception {
        t0Service.reloadCache();
        XxlJobLogger.log("RefreshT0SortList-JOB, success");
        return SUCCESS;
    }
}
